#ifndef EDITORCONFIGURATION_H
#define EDITORCONFIGURATION_H

#include <map>
#include "scrollingdialog.h"
#include <wx/arrstr.h>

class cbStyledTextCtrl;
class EditorColourSet;
class wxListbookEvent;

class EditorConfigurationDlg : public wxScrollingDialog {
  public:
    EditorConfigurationDlg( wxWindow* parent );
    ~EditorConfigurationDlg();
  private:
    void OnChooseFont( wxCommandEvent& event );
    void OnChooseColour( wxCommandEvent& event );
    void OnSetDefaultColour( wxCommandEvent& event );
    void OnBoldItalicUline( wxCommandEvent& event );
    void OnColourTheme( wxCommandEvent& event );
    void OnAddColourTheme( wxCommandEvent& event );
    void OnDeleteColourTheme( wxCommandEvent& event );
    void OnRenameColourTheme( wxCommandEvent& event );
    void OnColourComponent( wxCommandEvent& event );
    void OnColoursReset( wxCommandEvent& event );
    void OnColoursCopyFrom( wxCommandEvent& event );
    void OnMenuColoursCopyFrom( wxCommandEvent& event );
    void OnColoursCopyAllFrom( wxCommandEvent& event );
    void OnMenuColoursCopyAllFrom( wxCommandEvent &event );
    void OnEditKeywords( wxCommandEvent& event );
    void OnEditFilemasks( wxCommandEvent& event );
    void OnChangeLang( wxCommandEvent& event );
    void OnDynamicCheck( wxCommandEvent& event );
    void OnHighlightOccurrences( wxCommandEvent& event );
    void OnMultipleSelections( wxCommandEvent& event );
    void UpdateSampleFont( bool askForNewFont );
    void OnCaretStyle( wxCommandEvent& event );
    void EndModal( int retCode );
  private:
    void OnPageChanged( wxListbookEvent& event );
    void AddPluginPanels();
    void LoadListbookImages();
    void UpdateListbookImages();
    void CreateColoursSample();
    void ApplyColours();
    void FillColourComponents();
    void ReadColours();
    void WriteColours();
    void LoadThemes();
    void ChangeTheme();
    bool AskToSaveTheme();
    void UpdateColourControls( const OptionColour *opt );
  private:
    struct MenuItemLanguageOptionID {
      wxString langID;
      int index;
    };
    typedef std::map<long, MenuItemLanguageOptionID> MenuIDToLanguageOption;
  private:
    M_Code_StyledTextCtrl* m_TextColourControl;
    EditorColourSet* m_Theme;
    HighlightLanguage m_Lang;
    bool m_ThemeModified;
    ConfigurationPanelsArray m_PluginPanels;
    wxString m_FontString;
    bool m_EnableChangebar;
    bool m_EnableScrollWidthTracking;
    bool xml_File_lock;
    MenuIDToLanguageOption m_MenuIDToLanguageOption;
    wxImageList* m_pImageList;
    DECLARE_EVENT_TABLE()
};

#endif
